package demo2;
import java.util.Map;
import java.util.TreeMap;
import java.util.HashMap;

/**
 * 测试使用Map*/
public class TestMap {
    /**
     * 要注意的是，Map是一个接口，不可以实例化对象
     * TreeMap
     * TreeMap 的底层结构为红黑树*/
    public static void main(String[] args) {
        Map<String,String> map = new TreeMap<>();
        map.put("刘二","18271045266");
        map.put("王五","18147551143");
        map.put("张三","19320221066");
        map.put("李四","19390175996");
        System.out.println(map);
        System.out.println("===========");

        Map<String,String> map1 = new HashMap<>();
        map1.put("刘二","18271045266");
        map1.put("王五","18147551143");
        map1.put("张三","19320221066");
        map1.put("李四","19390175996");
        System.out.println(map1);
    }
}
